<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../../templates/applicationTemplate.xhtml"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j">

    <ui:define name="title">
        SGA - #{matchManagedBean.editorPanelTitle}
    </ui:define>

    <ui:define name="content">

        <h:form id="matchEditorForm">

            <rich:panel id="matchEditor" style="overflow: hidden;" >

                <f:facet name="header" >
                    <h:outputText styleClass="mainPanel" 
                                  value="#{matchManagedBean.editorPanelTitle}" />
                </f:facet>

                <ui:include src="./form.xhtml" >
                    <ui:param name="match" value="#{matchManagedBean.currentlyManagedMatch}" />
                    <ui:param name="matchBean" value="#{matchManagedBean}" />
                    <ui:param name="goalBean" value="#{matchManagedBean.goalManagedBean}" />
                </ui:include>

                <div style="float: right; margin: 5px;" >
                    <a4j:commandButton styleClass="editorActionButton"
                                       value="#{matchManagedBean.editorButtonLabel}"
                                       action="#{matchManagedBean.handleAction}" />
                    <a4j:commandButton styleClass="editorCancelButton" 
                                       value="#{bundle.cancelButton}"
                                       action="#{matchManagedBean.processActionAndRedirect('VIEW')}"
                                       immediate="true" />
                </div>

            </rich:panel>

        </h:form>

    </ui:define>

</ui:composition>
